package com.lemon.cloud.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lemon.cloud.comm.po.SysRole;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysRoleMapper extends BaseMapper<SysRole> {

    List<SysRole> selectByUserId(@Param("userId") Long userId);

    void delRolePermission(@Param("menuId") Long menuId, @Param("roleId") Long roleId);

    IPage<SysRole> getRoleByPage(@Param("page") Page page, @Param("role") SysRole role);

    void delRoleMenu(@Param("id")Long id);

    void saveRoleMenus(@Param("roleId")Long roleId,@Param("menus") List<String> menus);

    void addBatch(@Param("list")List<SysRole> list);

}
